import random
import uiautomator2 as u2

d = u2.connect('emulator-5554')

if __name__ == '__main__':
    d.app_start("net.gsantner.markor_test")
    if random.randint(0, 1) == 0:
        d(resourceId="net.gsantner.markor_test:id/smallLabel", text="QuickNote").click()
    else:
        d(resourceId="net.gsantner.markor_test:id/smallLabel", text="To-Do").click()
    choice = random.randint(0, 2)
    if choice == 0:
        d(description="优先级").click()
    elif choice == 1:
        d(description="特殊按键").click()
    elif choice == 2:
        d(description="附件").click()
    d(resourceId="android:id/button1").click()
